#include "PMeshManager.h"
#include <iostream>

float* MeshProcessing::PMeshManager::allocateVertexBuffer(uint vertextBufferLength)
{
	return new float[vertextBufferLength];
}

uint* MeshProcessing::PMeshManager::allocateIndicesBuffer(uint indexBufferLength)
{
	return new uint[indexBufferLength];
}

Handle MeshProcessing::PMeshManager::allocateBuffer(uint num, uint type)
{
	using namespace MeshProcessing;

	if (type == 0) {
		return (Handle)PMeshManager::allocateVertexBuffer(num);
	}
	else {
		return (Handle)PMeshManager::allocateIndicesBuffer(num);
	}
}

MeshProcessing::PMesh* MeshProcessing::PMeshManager::createPMesh() {
	return new PMesh();
}
void MeshProcessing::PMeshManager::destroyMesh(PMesh* mesh)
{
	delete mesh;
}

void MeshProcessing::PMeshManager::destroyPMesh(Handle mesh) {
	destroyMesh((PMesh*)mesh);
}
